<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			{{name}}
			<input type="text" v-model="num1" />+
			<input type="text" v-model="num2" />=
			<span v-text="result"></span>
			<button v-on:click="change">计算</button>
		</div>
		
	</body>
	<script src="vue.min.js"></script>
	
	<script>
		var VM = new Vue({
			el:"#app",
			data:{
				name:'wxz',
				num1:0,
				num2:0,
				result:0
			},
			methods:{
				change:function(){
					this.result=Number.parseInt(this.num1)+Number.parseInt(this.num2)
				}
			}
		});
		
	</script>
</html>
